<?php

namespace App\Http\Controllers\Internal;

use App\Models\Series;

class SeriesController extends Controller
{
    /*
     * @api get /internal/series/{seriesId} 获取课程
     * @version 0.0.1
     * @group internal
     *
     * @param path int seriesId 系列ID
     *
     * @response 200 正常结果 {
     *  "code":0,
     *  "msg":"",
     *  "data":{}
     * }
     *
     */
    public function show($seriesId)
    {
        $data = [];
        /** @var Series $seriesObj */
        $seriesObj = Series::find($seriesId);
        if ($seriesObj) {
            $data = [
                'id' => $seriesObj->getId(),
                'name' => $seriesObj->getName(),
            ];
        }
        return $this->sendSuccessJson($data);
    }

}
